package com.oocl.heather.main;

import java.io.File;
import java.util.List;
import java.util.Set;

import com.oocl.heather.Service.impl.Parser;
import com.oocl.heather.comparator.impl.CustomerBirthComparator;
import com.oocl.heather.comparator.impl.CustomerIdComparator;
import com.oocl.heather.entity.Customer;
import com.oocl.heather.generator.impl.XmlGenerator;
import com.oocl.heather.printer.impl.Printer;
import com.oocl.heather.processor.impl.Processor;
import com.oocl.heather.scanner.impl.ScannerTxt;
import com.oocl.heather.validator.impl.Validator;

public class Client {

	public static void main(String[] args) {
		// TODO Auto-generated method stub

		File f = new File("customer.txt");//Text文件
		List<String> list=new ScannerTxt().scan(f);//input the txt
		
		
		Validator va=new Validator();
		List<String> list1=new Processor().process(list, va);//验证
		
		
		Parser pa=new Parser();
		CustomerIdComparator customerIdComparator=new CustomerIdComparator();
		Set<Customer> p=pa.parse(list1, customerIdComparator);
		
		
		Printer print=new Printer();
		System.out.println("id:");
		print.print(p, customerIdComparator);//id
		
		System.out.println("birth:");
		CustomerBirthComparator customerBirthComparator=new CustomerBirthComparator();
		print.print(p, customerBirthComparator);
		
		XmlGenerator xml=new XmlGenerator();//id xml
		print.print(p, customerIdComparator, xml);
		
		
	}

}
